package org.herui.campus.common.exception;

import com.mlnx.common.entity.BaseExceptionMsg;
import lombok.Data;

/**
 * Created by amanda.shan on 2019/7/1.
 */
@Data
public class ServiceException extends RuntimeException {

    private String code;

    private String describe;

    public ServiceException(String code, String describe) {
        super(describe);
        this.code = code;
        this.describe = describe;
    }

    public ServiceException(BaseExceptionMsg responseEnum) {
        super(responseEnum.getMsg());
        this.code = responseEnum.getCode();
        this.describe = responseEnum.getMsg();
    }

    public ServiceException() {
    }

    public ServiceException(String message) {
        super(message);
        this.describe = message;
    }

    public ServiceException(String message, Throwable cause) {
        super(message, cause);
    }

    public ServiceException(Throwable cause) {
        super(cause);
    }

    public ServiceException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }
}
